//
// Created by liushuai on 2021/2/19.
//

#include "arrangeCoins.h"
int arrangeCoins(int n){
    if (n <=1)
        return n;
    int i = 1;
    long long sum = 1;
    int count = 1;
    for(int i=2;i<n;i++){
        sum += i;
        if(sum>n)
            break;
        count++;
    }
    return count;
}